<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Subtracts a scalar value</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.sodium-crypto-core-ristretto255-scalar-reduce.html">« sodium_crypto_core_ristretto255_scalar_reduce</a></li>
      <li style="float: right;"><a href="function.sodium-crypto-core-ristretto255-sub.html">sodium_crypto_core_ristretto255_sub »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.sodium.html">Sodium 函数</a></li>
    <li>Subtracts a scalar value</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.sodium-crypto-core-ristretto255-scalar-sub" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sodium_crypto_core_ristretto255_scalar_sub</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.1.0)</p><p class="refpurpose"><span class="refname">sodium_crypto_core_ristretto255_scalar_sub</span> &mdash; <span class="dc-title">Subtracts a scalar value</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sodium-crypto-core-ristretto255-scalar-sub-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>sodium_crypto_core_ristretto255_scalar_sub</strong></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$x</code></span>, <span class="methodparam"><span class="type">string</span> <code class="parameter">$y</code></span>): <span class="type">string</span></div>

  <p class="para rdfs-comment">
   Subtracts a scalar <code class="parameter">y</code> from <code class="parameter">x</code>.
   Available as of libsodium 1.0.18.
  </p>

  <div class="warning"><strong class="warning">警告</strong><p class="simpara">本函数还未编写文档，仅有参数列表。</p></div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.sodium-crypto-core-ristretto255-scalar-sub-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt>
<code class="parameter">x</code></dt>

    <dd>

     <p class="para">
      Scalar, representing the X coordinate.
     </p>
    </dd>

   
   
    <dt>
<code class="parameter">y</code></dt>

    <dd>

     <p class="para">
      Scalar, representing the Y coordinate.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sodium-crypto-core-ristretto255-scalar-sub-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a 32-byte random <span class="type">string</span>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.sodium-crypto-core-ristretto255-scalar-sub-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-984">
    <p><strong>示例 #1 <span class="function"><strong>sodium_crypto_core_ristretto255_scalar_sub()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$foo&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sodium_crypto_core_ristretto255_scalar_random</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$bar&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sodium_crypto_core_ristretto255_scalar_random</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sodium_crypto_core_ristretto255_scalar_add</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$bar</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$value&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">sodium_crypto_core_ristretto255_scalar_sub</span><span style="color: #007700">(</span><span style="color: #0000BB">$value</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$bar</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">hash_equals</span><span style="color: #007700">(</span><span style="color: #0000BB">$foo</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$value</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
bool(true) 
</pre></div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.sodium-crypto-core-ristretto255-scalar-sub-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.sodium-crypto-core-ristretto255-scalar-random.html" class="function" rel="rdfs-seeAlso">sodium_crypto_core_ristretto255_scalar_random()</a> - Generates a random key</span></li>
    <li class="member"><span class="function"><a href="function.sodium-crypto-core-ristretto255-scalar-add.html" class="function" rel="rdfs-seeAlso">sodium_crypto_core_ristretto255_scalar_add()</a> - Adds a scalar value</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>